Install KVM
2013/12/23 |
It's Virtualization with KVM ( Kernel-based Virtual Machine ) + QEMU.
This requires that the CPU on your computer has a function Intel VT or AMD-V.
|
|
[1] | Install KVM |
[root@dlp ~]#
[root@dlp ~]# yum -y install qemu-kvm libvirt virt-install bridge-utils kvm_intel 43336 0 kvm 306680 1 kvm_intel [root@dlp ~]# systemctl start libvirtd.service [root@dlp ~]# systemctl enable libvirtd.service |
[2] | Configure Bridge networking for KVM virtual machine. (Replace the ifcfg-eth0 to the name of interface on your system.) |
[root@dlp ~]# cd /etc/sysconfig/network-scripts [root@dlp network-scripts]# cp ifcfg-eth0 ifcfg-br0
[root@dlp network-scripts]#
vi ifcfg-br0 # change like follows
TYPE=Bridge BOOTPROTO=none DEVICE=br0 ONBOOT=yes IPADDR=10.0.0.30 NETMASK=255.255.255.0 GATEWAY=10.0.0.1 DNS1=10.0.0.10
[root@dlp network-scripts]#
vi ifcfg-eth0 # change like follows
TYPE=Ethernet DEVICE=eth0 ONBOOT=yes BRIDGE=br0
[root@dlp network-scripts]#
[root@dlp ~]# br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.0.30 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::5054:ff:fed2:1a90 prefixlen 64 scopeid 0x20<link> ether 52:54:00:d2:1a:90 txqueuelen 0 (Ethernet) RX packets 48 bytes 3871 (3.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 60 bytes 4284 (4.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::5054:ff:fed2:1a90 prefixlen 64 scopeid 0x20<link> ether 52:54:00:d2:1a:90 txqueuelen 1000 (Ethernet) RX packets 48 bytes 4543 (4.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 67 bytes 4812 (4.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 8 bytes 968 (968.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8 bytes 968 (968.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 7e:24:12:72:29:ec txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |